package com.golf.comms.protocol;

import java.io.Serializable;
import java.util.Date;

public class ChatMessage implements Serializable
{

	private String user;
	
	private String message;
	
	private Date time;
	
	
	public ChatMessage()
	{
		// Do nothing.
	}
	
	public ChatMessage(final String user, final String message)
	{
		this.user = user;
		this.message = message;
	}

	
	public String getuser()
	{
		return user;
	}
	
	public String getMessage()
	{
		return message;
	}
	
	public Date getTime()
	{
		if (time != null)
		{
			return new Date(time.getTime());
		}
		
		return null;
	}
	
	public void setUser(final String user)
	{
		this.user = user;
	}
	
	public void setMessage(final String message)
	{
		this.message = message;
	}
	
	public void setTime(final Date time)
	{
		if (time != null)
		{
			this.time = new Date(time.getTime());
		}
		else
		{
			this.time = null;
		}
	}
}
